package com.atguigu.bigdata.scala.mytest.chapter07
import java.io

import scala.collection.immutable

object Test_List {
  def main(args: Array[String]): Unit = {
    val strings = List("a","b","c")
    val strings1 = List("d","e","f")

    val strings2: List[String] = strings :+ "A"
    println(strings2)//List(a, b, c, A)
    println(strings eq strings2)//false

    val seq: immutable.IndexedSeq[Any] = strings +: "A"
    println(seq)//Vector(List(d, e, f), D)

    val strings3: List[String] = "A"+:strings
    println(strings3)//List(A, a, b, c)

    val strings4: List[String] = "D"::strings
    println(strings4)//List(D, a, b, c)

    val serializables: List[io.Serializable] = strings::strings1
    println(serializables)//List(List(a, b, c), d, e, f)

    val serializables1: List[io.Serializable] = strings1::strings
    println(serializables1)//List(List(d, e, f), a, b, c)

    val strings5: List[String] = strings:::strings1
    println(strings5)//List(a, b, c, d, e, f)

  }
}
